from django.conf.urls import patterns, include, url

from django.contrib import admin

admin.autodiscover()

urlpatterns = patterns('',
                       url(r'^$', 'mysite.views.home', name='home'),

                       url(r'^register', 'account.views.register', name='register'),
                       url(r'^login', 'account.views.login', name='login'),
                       url(r'^logout', 'account.views.logout', name='logout'),
                       url(r'^active/(?P<token>\w{32})', 'account.views.active', name='active'),
                       url(r'^password-reset-done', 'account.views.password_reset_done', name='password_reset_done'),
                       url(r'^password-reset-confirm/(?P<uidb64>\w+)/(?P<token>[-\w]+)',
                           'account.views.password_reset_confirm', name='password_reset_confirm'),
                       url(r'^password-reset-complete', 'account.views.password_reset_complete',
                           name='password_reset_complete'),
                       url(r'^password-reset', 'account.views.password_reset', name='password_reset'),

                       url(r'^accounts/profile', 'account.views.profile', name='profile'),
                       url(r'^accounts/avatar', 'account.views.avatar', name='avatar'),

                       url(r'^teams/(\d+)/setting$', 'team.views.setting', name='team_setting'),
                       url(r'^teams/(\d+)$', 'team.views.view', name='team_view'),
                       url(r'^teams/(\d+)/invite$', 'team.views.invite', name='team_invite'),
                       url(r'^teams/join/(?P<token>[\w\d]+)$', 'team.views.join', name='team_join'),
                       url(r'^teams/invitations/(?P<token>[\w\d]+)/delete$', 'team.views.invitation_delete',
                           name='team_invitation_delete'),
                       url(r'^teams/members/(?P<ship_id>\d+)/(?P<action>upgrade|downgrade)$', 'team.views.change_role',
                           name='team_change_role'),
                       url(r'^teams/members/(?P<ship_id>\d+)/remove$', 'team.views.remove_member',
                           name='team_remove_member'),

                       url(r'^admin/', include(admin.site.urls)),
)
